﻿@extends('wechat.layouts.base')
@section("js_files")
    <script src="{{asset('dist/wechat/js/index/build.js')}}"></script>
    <script src="{{asset('dist/wechat/js/share_file.js')}}"></script>
@endsection
@section('content')
    <!--展示图-->
    <div class="msg">
        <div class="person">
            <div class="headpic">
                <img src="{{$user->headimgurl}}" />
            </div>
            <p>{{$user->nickname}}</p>
        </div>
       <!--  <div class="btn2 clear">
            <a href="{{url('wechat/mine/award')}}">查看奖品</a>
        </div> -->
    </div>
    <div class="mineshow">
        <div class="list5">
            <h4>最近看过：</h4>
            <ul id="recentview" class="clear">
                @foreach($BuildLog as $row)
                <li><a href="{{url('wechat/index/build/detailed')}}?id={{$row->build->id}}"><img src="{{$row->build->logo}}"/></a></li>
                    @endforeach

            </ul>
        </div>
		<div class="wrap" style="margin-top: 5%; height: auto;">
			<h4>我的奖品</h4>
			<div class="wrapCon">
				@if(count($prize_logs))
					@foreach($prize_logs as $row)
					<div class="star">
						<span class="btnShow"><img src="{{$row->prize->attach->path}}"></span>
						<div class="detail">
							<div class="weui-panel weui-panel_access">
                                <div class="weui-panel__hd">订单号:{{$row->order}}</div>
								<div class="weui-panel__bd">
									<div class="weui-media-box weui-media-box_text">
										<h4 class="weui-media-box__title">{{$row->prize->name}}</h4>
										<p class="weui-media-box__desc">{{$row->prize->info}}</p>
                                        @if($row->prize->id == 5)
                                            <img style="width:100px;height:100px;margin:0 35%;" src="https://oj7j4hqh8.qnssl.com/uploads/ueditor/php/upload/image/20170103/1483436068498477.jpeg"/>
                                        @endif
									</div>
								</div>
                                @if($row->status == 1)
                                    <div class="dh">
                                        <a href="{{url('wechat/mine')}}/exchange/{{$row->id}}">兑换</a>
                                    </div>
                                    @elseif($row->status == 2)
                                        <div class="dh over">
                                            <a>已兑换</a>
                                        </div>
                                    @else
                                        <div class="dh">

                                        </div>
                                    @endif
							</div>
						</div>
					</div>
					@endforeach
                @else
                    <p class="nothing">您未中奖~</p>
				@endif
			</div>
        </div>
    </div>
	<script>
        $(function(){
            $(".btnShow").click(function(){
                var scrollVal = $(this).attr("scroll");
                var show_list = $(this).siblings(".detail");
                show_list.toggleClass("show");
                $(this).parent(".star").siblings().find(".detail").removeClass("show");
                $('.middle').scrollTop(scrollVal);
            })
        });
    </script>
    @endsection
